<%@page import="com.framework.entity.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>

<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="UTF-8">
<title>商户登录</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<jsp:include page="/jsp/inc.jsp"></jsp:include>

</head>
<body class="plantbg">
<div class="txthello"><img src="<%=basePath%>resources/image/txt-welcome.png" alt="" class=""></div>
<div class="loginform">
	<div class="twoinput">
		<input type="text" id="loginName" class="per"  tautocomplete="off" name="loginName" placeholder="登录账户">
		<input type="password" id="pwd" class="pwd" tautocomplete="off" name="pwd" placeholder="密码">
	</div>
	<div class="">
		<button type="button" onclick="submit();" class="longbtn btn-blue">登录</button>
	</div>
</div>
<script src="<%=basePath%>resources/js/ydui.js"></script>
<script>
    function submit()
	{
		var loginName = $("#loginName").val();
		var pwd = $("#pwd").val();
		if(loginName == '')
		{
            window.YDUI.dialog.alert('用户名密码不能为空！');
		}else{
            var name=encodeURI($("#loginName").val());
			$.ajax({
				url:'${pageContext.request.contextPath}/merchant/doLogin.ac',
				type:'post',
				data:{loginName: name, pwd : pwd},
				dataType:'json',
				success:function(data)
				{
					if(data.success){
						//跳转
                        window.location.href=
							"${pageContext.request.contextPath}/merchant/toMerchantCenter.ac";
					}else{
                        window.YDUI.dialog.alert(data.msg);
					}
				}
			});
		}
	}




</script>
</body>
</html>
